package com.cater.sys.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cater.common.PageResult;
import com.cater.query.LogQuery;
import com.cater.sys.entity.Log;
import com.cater.sys.service.LogService;


/**
 * 
 * @描述:首页
 * @作者 :HuanGe
 * @创建日期 :2015年9月28日 上午10:59:06
 *
 */
@Controller
@RequestMapping("/log")
public class LogController {

	@Autowired
	LogService logService;

	@RequestMapping("list")
	public String list(Model model) {
		return "sys/log/log_list";
	}

	@ResponseBody
	@RequestMapping("listData")
	public PageResult<Log> listData(LogQuery logQuery) {
		logQuery.setType(0);
		PageResult<Log> result = logService.findPageResult(logQuery);
		return result;
	}

	@ResponseBody
	@RequestMapping("listExceptionData")
	public PageResult<Log> listExceptionData(LogQuery logQuery) {
		logQuery.setType(1);
		PageResult<Log> result = logService.findPageResult(logQuery);
		return result;
	}

}
